﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using System.Windows;

namespace UniversalQin
{
    public partial class CustomWindow
    {
        void Minimized(object sender, RoutedEventArgs e)
        {
            Window.GetWindow(sender as FrameworkElement).WindowState = WindowState.Minimized;
        }
        void Normal(object sender, RoutedEventArgs e)
        {
            Window.GetWindow(sender as FrameworkElement).WindowState = WindowState.Normal;
        }
        void Maximized(object sender, RoutedEventArgs e)
        {
            Window.GetWindow(sender as FrameworkElement).WindowState = WindowState.Maximized;
        }
        void Close(object sender, RoutedEventArgs e)
        {
            Window.GetWindow(sender as FrameworkElement).Hide();
        }
    }
}

namespace Control
{
    public class CustomWindow : Window
    {
        public object Menu
        {
            get { return (object)GetValue(MenuProperty); }
            set { SetValue(MenuProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Menu.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty MenuProperty =
            DependencyProperty.Register("Menu", typeof(object), typeof(CustomWindow), new PropertyMetadata(""));

        public Brush NewBackGround
        {
            get { return (Brush)GetValue(NewBackGroundProperty); }
            set { SetValue(NewBackGroundProperty, value); }
        }

        // Using a DependencyProperty as the backing store for NewBackGround.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty NewBackGroundProperty =
            DependencyProperty.Register("NewBackGround", typeof(Brush), typeof(CustomWindow), new PropertyMetadata(Brushes.Transparent));
    }
}